package com.warehouse.result;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Map;

/**
 * 统一结果封装类
 * @author 卓汉杰
 * @version 1.0.0
 *
 * */
@ApiModel("统一结果封装类")
public class Result {

    // 成功
    public static final Integer OK = 200;

    // 服务器异常
    public static final Integer ON = 500;

    // 客户端异常
    public static final Integer NULL = 400;

    // 客户端异常
    public static final Integer guo = 401;

    //数据部分
    @ApiModelProperty("数据部分")
    private Map<String,Object> data;

    //状态码
    @ApiModelProperty("状态码")
    private Integer code;

    //响应状态概述
    @ApiModelProperty("响应状态概述")
    private String massage;

    public Result() {
    }

    public Result(Map<String, Object> data, Integer code, String massage) {
        this.data = data;
        this.code = code;
        this.massage = massage;
    }



    @Override
    public String toString() {
        return "Result{" +
                "data=" + data +
                ", code=" + code +
                ", massage='" + massage + '\'' +
                '}';
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMassage() {
        return massage;
    }

    public void setMassage(String massage) {
        this.massage = massage;
    }


}
